﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Account/Site.master" AutoEventWireup="true" CodeFile="data.aspx.cs" Inherits="data" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <p>
        Sản phẩm</p>
    <p>
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
            AutoGenerateColumns="False" DataKeyNames="MaSanPham" 
            DataSourceID="SqlDataSource1" EnableModelValidation="True">
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                <asp:BoundField DataField="MaSanPham" HeaderText="MaSanPham" ReadOnly="True" 
                    SortExpression="MaSanPham" />
                <asp:BoundField DataField="GiaBan" HeaderText="GiaBan" 
                    SortExpression="GiaBan" />
                <asp:BoundField DataField="NgayCapNhat" HeaderText="NgayCapNhat" 
                    SortExpression="NgayCapNhat" />
                <asp:BoundField DataField="LoaiID" HeaderText="LoaiID" 
                    SortExpression="LoaiID" />
                <asp:CheckBoxField DataField="Xoa" HeaderText="Xoa" SortExpression="Xoa" />
                <asp:BoundField DataField="GioiThieu" HeaderText="GioiThieu" 
                    SortExpression="GioiThieu" />
                <asp:BoundField DataField="ChucNangID" HeaderText="ChucNangID" 
                    SortExpression="ChucNangID" />
                <asp:BoundField DataField="NhanHieuID" HeaderText="NhanHieuID" 
                    SortExpression="NhanHieuID" />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectServer %>" 
            DeleteCommand="DELETE FROM [SanPham] WHERE [MaSanPham] = @MaSanPham" 
            InsertCommand="INSERT INTO [SanPham] ([MaSanPham], [GiaBan], [NgayCapNhat], [LoaiID], [Xoa], [GioiThieu], [ChucNangID], [NhanHieuID]) VALUES (@MaSanPham, @GiaBan, @NgayCapNhat, @LoaiID, @Xoa, @GioiThieu, @ChucNangID, @NhanHieuID)" 
            SelectCommand="SELECT * FROM [SanPham]" 
            UpdateCommand="UPDATE [SanPham] SET [GiaBan] = @GiaBan, [NgayCapNhat] = @NgayCapNhat, [LoaiID] = @LoaiID, [Xoa] = @Xoa, [GioiThieu] = @GioiThieu, [ChucNangID] = @ChucNangID, [NhanHieuID] = @NhanHieuID WHERE [MaSanPham] = @MaSanPham">
            <DeleteParameters>
                <asp:Parameter Name="MaSanPham" Type="String" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="MaSanPham" Type="String" />
                <asp:Parameter Name="GiaBan" Type="Double" />
                <asp:Parameter Name="NgayCapNhat" Type="DateTime" />
                <asp:Parameter Name="LoaiID" Type="Int32" />
                <asp:Parameter Name="Xoa" Type="Boolean" />
                <asp:Parameter Name="GioiThieu" Type="String" />
                <asp:Parameter Name="ChucNangID" Type="Int32" />
                <asp:Parameter Name="NhanHieuID" Type="Int32" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="GiaBan" Type="Double" />
                <asp:Parameter Name="NgayCapNhat" Type="DateTime" />
                <asp:Parameter Name="LoaiID" Type="Int32" />
                <asp:Parameter Name="Xoa" Type="Boolean" />
                <asp:Parameter Name="GioiThieu" Type="String" />
                <asp:Parameter Name="ChucNangID" Type="Int32" />
                <asp:Parameter Name="NhanHieuID" Type="Int32" />
                <asp:Parameter Name="MaSanPham" Type="String" />
            </UpdateParameters>
        </asp:SqlDataSource>
    </p>
    <p>
        Loại<asp:GridView ID="GridView2" runat="server" AllowPaging="True" 
            AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="ID" 
            DataSourceID="SqlDataSource2" EnableModelValidation="True">
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" 
                    ReadOnly="True" SortExpression="ID" />
                <asp:BoundField DataField="TenLoai" HeaderText="TenLoai" 
                    SortExpression="TenLoai" />
                <asp:BoundField DataField="GhiChu" HeaderText="GhiChu" 
                    SortExpression="GhiChu" />
                <asp:CheckBoxField DataField="Xoa" HeaderText="Xoa" SortExpression="Xoa" />
                <asp:BoundField DataField="SapXep" HeaderText="SapXep" 
                    SortExpression="SapXep" />
            </Columns>
        </asp:GridView>
        Thương hiệu<asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectServer %>" 
            DeleteCommand="DELETE FROM [Loai] WHERE [ID] = @ID" 
            InsertCommand="INSERT INTO [Loai] ([TenLoai], [GhiChu], [Xoa], [SapXep]) VALUES (@TenLoai, @GhiChu, @Xoa, @SapXep)" 
            SelectCommand="SELECT * FROM [Loai]" 
            UpdateCommand="UPDATE [Loai] SET [TenLoai] = @TenLoai, [GhiChu] = @GhiChu, [Xoa] = @Xoa, [SapXep] = @SapXep WHERE [ID] = @ID">
            <DeleteParameters>
                <asp:Parameter Name="ID" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="TenLoai" Type="String" />
                <asp:Parameter Name="GhiChu" Type="String" />
                <asp:Parameter Name="Xoa" Type="Boolean" />
                <asp:Parameter Name="SapXep" Type="Int32" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="TenLoai" Type="String" />
                <asp:Parameter Name="GhiChu" Type="String" />
                <asp:Parameter Name="Xoa" Type="Boolean" />
                <asp:Parameter Name="SapXep" Type="Int32" />
                <asp:Parameter Name="ID" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>
    </p>
    <p>
        <asp:GridView ID="GridView3" runat="server" AllowPaging="True" 
            AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="ID" 
            DataSourceID="SqlDataSource3" EnableModelValidation="True">
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" 
                    ReadOnly="True" SortExpression="ID" />
                <asp:BoundField DataField="Ten" HeaderText="Ten" SortExpression="Ten" />
                <asp:BoundField DataField="GhiChu" HeaderText="GhiChu" 
                    SortExpression="GhiChu" />
                <asp:CheckBoxField DataField="Xoa" HeaderText="Xoa" SortExpression="Xoa" />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectServer %>" 
            DeleteCommand="DELETE FROM [NhanHieu] WHERE [ID] = @ID" 
            InsertCommand="INSERT INTO [NhanHieu] ([Ten], [GhiChu], [Xoa]) VALUES (@Ten, @GhiChu, @Xoa)" 
            SelectCommand="SELECT * FROM [NhanHieu]" 
            UpdateCommand="UPDATE [NhanHieu] SET [Ten] = @Ten, [GhiChu] = @GhiChu, [Xoa] = @Xoa WHERE [ID] = @ID">
            <DeleteParameters>
                <asp:Parameter Name="ID" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="Ten" Type="String" />
                <asp:Parameter Name="GhiChu" Type="String" />
                <asp:Parameter Name="Xoa" Type="Boolean" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="Ten" Type="String" />
                <asp:Parameter Name="GhiChu" Type="String" />
                <asp:Parameter Name="Xoa" Type="Boolean" />
                <asp:Parameter Name="ID" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>
        <asp:GridView ID="GridView4" runat="server" AllowPaging="True" 
            AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="ID" 
            DataSourceID="SqlDataSource4" EnableModelValidation="True">
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" 
                    ReadOnly="True" SortExpression="ID" />
                <asp:BoundField DataField="Ten" HeaderText="Ten" SortExpression="Ten" />
                <asp:BoundField DataField="GhiChu" HeaderText="GhiChu" 
                    SortExpression="GhiChu" />
                <asp:CheckBoxField DataField="Xoa" HeaderText="Xoa" SortExpression="Xoa" />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource4" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectServer %>" 
            DeleteCommand="DELETE FROM [ChucNang] WHERE [ID] = @ID" 
            InsertCommand="INSERT INTO [ChucNang] ([Ten], [GhiChu], [Xoa]) VALUES (@Ten, @GhiChu, @Xoa)" 
            SelectCommand="SELECT * FROM [ChucNang]" 
            UpdateCommand="UPDATE [ChucNang] SET [Ten] = @Ten, [GhiChu] = @GhiChu, [Xoa] = @Xoa WHERE [ID] = @ID">
            <DeleteParameters>
                <asp:Parameter Name="ID" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="Ten" Type="String" />
                <asp:Parameter Name="GhiChu" Type="String" />
                <asp:Parameter Name="Xoa" Type="Boolean" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="Ten" Type="String" />
                <asp:Parameter Name="GhiChu" Type="String" />
                <asp:Parameter Name="Xoa" Type="Boolean" />
                <asp:Parameter Name="ID" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>
    </p>
    <p>
        <asp:GridView ID="GridView5" runat="server" AllowPaging="True" 
            AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="ID" 
            DataSourceID="SqlDataSource5" EnableModelValidation="True">
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" 
                    ReadOnly="True" SortExpression="ID" />
                <asp:BoundField DataField="URL" HeaderText="URL" SortExpression="URL" />
                <asp:BoundField DataField="MaSanPham" HeaderText="MaSanPham" 
                    SortExpression="MaSanPham" />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource5" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectServer %>" 
            DeleteCommand="DELETE FROM [HinhAnh] WHERE [ID] = @ID" 
            InsertCommand="INSERT INTO [HinhAnh] ([URL], [MaSanPham]) VALUES (@URL, @MaSanPham)" 
            SelectCommand="SELECT * FROM [HinhAnh]" 
            UpdateCommand="UPDATE [HinhAnh] SET [URL] = @URL, [MaSanPham] = @MaSanPham WHERE [ID] = @ID">
            <DeleteParameters>
                <asp:Parameter Name="ID" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="URL" Type="String" />
                <asp:Parameter Name="MaSanPham" Type="String" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="URL" Type="String" />
                <asp:Parameter Name="MaSanPham" Type="String" />
                <asp:Parameter Name="ID" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>
        <br />
    </p>
</asp:Content>

